# Contributor: Sam Dodrill <shadowh511@gmail.com>
# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: Sam Dodrill <shadowh511@gmail.com>
pkgname=py3-virtualenv
pkgver=20.14.1
pkgrel=0
pkgdesc="Virtual Python3 Environment builder"
options="!check" # Requires unpackaged 'flaky'
url="https://virtualenv.pypa.io/en/latest/"
arch="noarch"
license="MIT"
depends="python3 py3-platformdirs py3-distlib py3-filelock py3-six"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/v/virtualenv/virtualenv-$pkgver.tar.gz"
builddir="$srcdir/virtualenv-$pkgver"

replaces="py-virtualenv" # Backwards compatibility
provides="py-virtualenv=$pkgver-r$pkgrel" # Backwards compatibility

prepare() {
	default_prepare

	sed -e '/setuptools_scm/d' \
		-e '/use_scm_verison=/,/}/d' \
		-i setup.py
	sed -i "/^\[metadata\]/a version = $pkgver" setup.cfg
}

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
149e78787db23eabd4238baa172bf023ddcf87d59284fdd090269acfa15991aab182f9e168851f88ef810d5c50dd7cdce69d132c46ebedb10080d65a308e63a1  virtualenv-20.14.1.tar.gz
"
